package com.link2room.blaster.dto.inMail;


import com.link2room.common.enums.BaseSysExceptionEnum;
import com.link2room.common.exception.SysException;

import javax.websocket.Session;
import java.io.IOException;

/**
 * Created by LN on 2017/6/27.16:08
 */
public class WebSocketDto {
    private String ticket;
    private String userCode;
    private Session session;

    public String getTicket() {
        return ticket;
    }

    public void setTicket(String ticket) {
        this.ticket = ticket;
    }

    public String getUserCode() {
        return userCode;
    }

    public void setUserCode(String userCode) {
        this.userCode = userCode;
    }

    public Session getSession() {
        return session;
    }

    public void setSession(Session session) {
        this.session = session;
    }

    public void sendMessage(String message) {
        try {
            this.session.getBasicRemote().sendText(message);
        } catch (IOException e) {
            throw new SysException(BaseSysExceptionEnum.BASE_FUCATION_OPTION,e);
        }

    }
}
